package com.twu.biblioteca.Customers;

import java.util.ArrayList;
import java.util.List;

public class CustomerCollection {
    private List<Customer> customerList;

    public CustomerCollection(){
        customerList = new ArrayList<Customer>();
        this.customerList.add(new Customer("111-1111","hello"));
        this.customerList.add(new Customer("111-1112","hello"));
        this.customerList.add(new Customer("111-1113","hello"));
        this.customerList.add(new Customer("111-1114","hello"));
        this.customerList.add(new Customer("111-1115","hello"));
    }

    public boolean checkUsernameAndPassword(Customer customer) {
        for(Customer c : customerList){
            if(c.getUserName().equals(customer.getUserName()) && c.getPassword().equals(customer.getPassword())){
                return true;
            }
        }
        return false;
    }
}
